import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-trial/trial/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/blade-trial/trial/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const getTrialDetail = (id) => {
  return request({
    url: '/blade-trial/trial/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/blade-trial/trial/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/blade-trial/trial/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/blade-trial/trial/submit',
    method: 'post',
    data: row
  })
}

export const hospitalCaseNumOfTrial = (trialId) => {
  return request({
    url: '/blade-hospitalcasenum/hospitalCaseNum/hospitalCaseNumOfTrial',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const groupListOfTrial = (trialId) => {
  return request({
    url: '/blade-group/group/groupListOfTrial',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const hospitalCaseNumSubmit = (row) => {
  return request({
    url: '/blade-hospitalcasenum/hospitalCaseNum/submit',
    method: 'post',
    data: row
  })
}

export const hospitalCaseNumDetail = (id) => {
  return request({
    url: '/blade-hospitalcasenum/hospitalCaseNum/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const phoneCrf = (groupId) => {
  return request({
    url: '/blade-clinicalcase/clinicalCase/phoneCrf',
    method: 'get',
    params: {
      groupId
    }
  })
}

export const collectInfoSubmit = (row) => {
  return request({
    url: '/blade-collectinfo/collectInfo/submit',
    method: 'post',
    data: row
  })
}

export const collectInfoDetail = (trialId) => {
  return request({
    url: '/blade-collectinfo/collectInfo/detail',
    method: 'get',
    params: {
      trialId
    }
  })
}
export const clinicalCaseDetail = (id) => {
  return request({
    url: '/blade-clinicalcase/clinicalCase/detail',
    method: 'get',
    params: {
      id
    }
  })
}


export const informationListWithTrial = (current, size, params) => {
  return request({
    url: '/blade-information/information/listWithTrial',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const informationList = (current, size, params) => {
  return request({
    url: '/blade-information/information/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const eleMedicalRecordFileList = (current, size, params) => {
  return request({
    url: '/blade-information/information/eleMedicalRecordFileList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const informationRemove = (ids) => {
  return request({
    url: '/blade-information/information/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const informationSubmit = (row) => {
  return request({
    url: '/blade-information/information/submit',
    method: 'post',
    data: row
  })
}

export const updateStatus = (id,status) => {
  return request({
    url: '/blade-trial/trial/updateStatus',
    method: 'post',
    params: {
      id,
      status
    }
  })
}

export const overall = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/overall',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const numWithAgeGroup = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/numWithAgeGroup',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const numWithGroupDept = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/numWithGroupDept',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const groupSex = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/groupSex',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const deptSex = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/deptSex',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const numWithArea = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/numWithArea',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const groupNumOfMonth = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/groupNumOfMonth',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const deptNumOfMonth = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/deptNumOfMonth',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const deptGzl = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/deptGzl',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const caseNumOfCrf = (trialId) => {
  return request({
    url: '/blade-statistics/statistics/caseNumOfCrf',
    method: 'get',
    params: {
      trialId
    }
  })
}

export const deptGzlOfUser = (trialId,deptId) => {
  return request({
    url: '/blade-statistics/statistics/deptGzlOfUser',
    method: 'get',
    params: {
      trialId,
      deptId
    }
  })
}

export const clinicalCase = (trial) => {
  return request({
    url: '/blade-clinicalcase/clinicalCase/export-clinicalCase',
    method: 'get',
    params: {
      trial
    }
  })
}

export const allListOfUser = () => {
  return request({
    url: 'blade-trial/trial/allListOfUser',
    method: 'get',
  })
}

export const singleIndicatorVisualization = (trialId,groupId,phaseId,crfId,indicatorId) => {
  return request({
    url: '/blade-collectinfo/collectInfo/singleIndicatorVisualization',
    method: 'get',
    params: {
      trialId,
      groupId,
      phaseId,
      crfId,
      indicatorId
    }
  })
}

export const customExportPdf = (trialId,groupId,clinicalCaseIds,phaseCrfIds) => {
  return request({
    url: '/blade-collectinfo/collectInfo/customExportPdf',
    method: 'get',
    params: {
      trialId,
      groupId,
      clinicalCaseIds,
      phaseCrfIds,
    }
  })
}